#  g = (x*x for x in range(10))#创建生成器
# print(g)
# print(next(g))#获得g的下一个返回值
# print(next(g))
# print(next(g))
# for n in g:#g也是迭代对象
    # print(n)

def fib(max):
    c,a,b=0,0,1
    while a<max:
        yield b
        a,b=b,a+b
        c = c+1
    return 'done'
fib(6)

# def odd():
#     print('step 1')
#     yield 1
#     print('step 2')
#     yield(3)
#     print('step 3')
#     yield(5)
# o = odd()
# print(next(o))
# print(next(o))

for n in fib(6):
    print(n)
